/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package lesson3.com.demo.ser.better;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

import lesson3.com.demo.ser.Dog;


public class DeserializeCat {
    
    public static void main(String[] args) throws IOException, ClassNotFoundException{
        Cat myCat;
       
        
        File f = new File("fluffy.ser");
        FileInputStream fis = new FileInputStream(f);
        ObjectInputStream ois = new ObjectInputStream(fis);
        
        Object obj = ois.readObject();
        
        myCat = (Cat)obj;
        System.out.println("My deserialized cat : "+myCat.toString());
        
        ois.close();
        
    }

}
